<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/base.css" />
		<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
		<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
		<script type="text/javascript" src="<%=path%>/js/popup.js"></script>
		<script language="javascript" type="text/javascript"
			src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
			  <script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>
		<script language="javascript">
		   function save()
		    {
		    
		       
		         var name = document.getElementById('name').value;
		        if(name==null || name==''){
		           alert('请输入姓名');
		           return;
		        }
		        var tel = document.getElementById('ftel').value;
		        if(tel==null || tel==''){
		           alert('请输入电话');
		           return;
		        }
		        var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/; 
		        if(!myreg.test(tel)) 
				{ 
				    alert('请输入有效的手机号码！'); 
				    return; 
				} 
				
				var banji = $("#banji").val();
		        if(banji==0){
		           alert("请选择班级");
		           return;
		        }   

		        var jgselect = document.getElementById("fid");
		        var zyselect = document.getElementById("jgid");
		        var jgindex=jgselect.selectedIndex ;
				var jgtext = jgselect.options[jgindex].text;
				var zyindex=zyselect.selectedIndex ;
				var zytext = zyselect.options[zyindex].text;
				var orginazationtext=jgtext+zytext;
				document.getElementById("orginazation").value = orginazationtext;
		        document.formAdd.submit();
		    }
		    
		    
		     function changeSelect(){
		        var fids = $("#fid").val();
		        if(fid!=0){
		            $.post("<%=path%>/getJigouList.action", { fid: fids},
					   function(data){
					         var datas = eval(data);
					         $("#jgid").empty();
					         $("#jgid").append("<option value='0'>请选择</option>");
					         for(var i=0;i<datas.length;i++){
					             var jg = datas[i];
					              $("#jgid").append("<option value='"+jg.id+"'>"+jg.name+"</option>");
					         }
					   });
		        }
		    }
		     function bjSelect(){
		        var zids = $("#jgid").val();
		        if(zids!=0){
		            $.post("<%=path%>/getBanjiList.action", { zid: zids},
					   function(data){
					         var datas = eval(data);
					         $("#banji").empty();
					         $("#banji").append("<option value='0'>请选择</option>");
					         for(var i=0;i<datas.length;i++){
					             var jg = datas[i];
					              $("#banji").append("<option value='"+jg.id+"'>"+jg.name+"</option>");
					         }
					   });
		        }
		     }
		     
		    
        </script>
	</head>

	<body leftmargin="2" topmargin="9"
		background='<%=path%>/images/allbg.gif'>
		<form action="<%=path%>/studentEdit.action" name="formAdd"
			method="post">
			<input type="hidden" name="id" value="${student.id}" />
			<input type="hidden" id="uname" name="uname"
							value="${student.uname}" maxlength="50" />
					 
						 
<input type="hidden" id="upwd" name="upwd" value="${student.upwd}"
							maxlength="50" />
			<table width="98%" align="center" border="0" cellpadding="4"
				cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom: 8px">
				<tr bgcolor="#EEF4EA">
					<td colspan="3" background="<%=path%>/images/wbg.gif"
						class='title'>
						<span>修改</span>
					</td>
				</tr>


				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						学号：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="sno" name="sno" value="${student.sno}"
							maxlength="50" />

					</td>
				</tr>

				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						姓名：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="name" name="name" value="${student.name}"
							maxlength="50" />

					</td>
				</tr>

				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						性别：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
					 
                        <select  id="sex" name="sex">
                           <option <c:if test="${student.sex=='男'}">selected</c:if> value="男">男</option>
                            <option <c:if test="${student.sex=='女'}">selected</c:if> value="女">女</option>
                        </select>
					</td>
				</tr>

				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						出生日期：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="birthday" name="birthday"
							value="${student.birthday}" maxlength="20"   readonly="readonly" onClick="WdatePicker()"/>

					</td>
				</tr>

				 

				 
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						联系电话：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="ftel" name="ftel" value="${student.ftel}"
							maxlength="50" /> 

					</td>
				</tr>

				  
				  <tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"    id="yxtr"  
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						班级：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
					  
						<select name="fid" id="fid" onchange="changeSelect();">
						      <option value="0" >请选择</option>
							  <c:forEach items="${jigouList}" var="jg">
							        <option <c:if test="${yx.id == jg.id}">selected</c:if> value="${jg.id}">${jg.name}</option>
							  </c:forEach>
						</select>
						
						<select name="jgid" id="jgid" onchange="bjSelect();">
						
						    <option value="0" >请选择</option>
							  <c:forEach items="${xlist}" var="jg">
							        <option <c:if test="${student.jgid == jg.id}">selected</c:if> value="${jg.id}">${jg.name}</option>
							  </c:forEach>
						     
						</select>


                      <select name="banji" id="banji">
						
						    <option value="0" >请选择</option>
							  <c:forEach items="${blist}" var="bj">
							        <option <c:if test="${student.banji == bj.id}">selected</c:if> value="${bj.id}">${bj.name}</option>
							  </c:forEach>
						     
						</select>
						
						
					</td>
				</tr>
				
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						年级：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="nj" name="nj" value="${student.nj}" maxlength="50" />  

					</td>
				</tr>
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						面貌：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="face" name="face" value="${student.face}" maxlength="50" />  

					</td>
				</tr>
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						民族：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="nation" name="nation" value="${student.nation}" maxlength="50" />  

					</td>
				</tr>
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						身份证号：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="idnumber" name="idnumber" value="${student.idnumber}" maxlength="50" />  

					</td>
				</tr>
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						省份：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="provice" name="provice" value="${student.provice}" maxlength="50" />  

					</td>
				</tr>
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						地址：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="address" name="address" value="${student.address}" maxlength="50" />  

					</td>
				</tr>
				
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						学制：
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="text" id="level" name="level" value="${student.level}" maxlength="50" />  

					</td>
				</tr>
				<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='red';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td width="25%" bgcolor="#FFFFFF" align="right">
						&nbsp;
					</td>
					<td width="75%" bgcolor="#FFFFFF" align="left">
						<input type="hidden" id="orginazation" name="orginazation" value="${student.orginazation}"/>
						<input type="button" value="提交" onclick="save()" />
						&nbsp;
						<input type="reset" value="重置" />
						&nbsp;
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>